package com.example.freeengine.wallpaper.persistence.entity;

import androidx.room.ColumnInfo;
import androidx.room.Entity;
import androidx.room.PrimaryKey;

import com.google.common.base.Objects;

/**
 * @author Terry Deng
 */

@Entity(tableName = "wallpaper_cyclerefresh_album_item")
public class WallPaperCycleRefreshAlbumItem {

    @PrimaryKey(autoGenerate = true)
    Long id;

    @ColumnInfo(name = "album_id")
    Long albumId;

    @ColumnInfo(name = "picture_path")
    String picturePath;

    @ColumnInfo(name = "refresh_order")
    Integer refreshOrder;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getAlbumId() {
        return albumId;
    }

    public void setAlbumId(Long albumId) {
        this.albumId = albumId;
    }

    public String getPicturePath() {
        return picturePath;
    }

    public void setPicturePath(String picturePath) {
        this.picturePath = picturePath;
    }

    public Integer getRefreshOrder() {
        return refreshOrder;
    }

    public void setRefreshOrder(Integer refreshOrder) {
        this.refreshOrder = refreshOrder;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        WallPaperCycleRefreshAlbumItem that = (WallPaperCycleRefreshAlbumItem) o;
        return Objects.equal(id, that.id) && Objects.equal(albumId, that.albumId) && Objects.equal(picturePath, that.picturePath) && Objects.equal(refreshOrder, that.refreshOrder);
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(id, albumId, picturePath, refreshOrder);
    }
}
